import java.util.Scanner;

public class Administer {
    String name;
    int age;
    String department;
    int password;
    public void show(){
        System.out.println("姓名为"+name);
        System.out.println("年龄为"+age);
        System.out.println("部门为"+department);
        System.out.println("通行密码为"+password);
    }
    public void ChangePassword(){
        Scanner input=new Scanner(System.in);
        System.out.println("请输入姓名");
        name=input.next();
        System.out.println("请输入密码");
        password=input.nextInt();
        while (true){
            if (name.equals("admin")&&password==111111){
                System.out.println("请输入新密码");
                int p2=input.nextInt();
                System.out.println("请再次确认密码");
                int p3=input.nextInt();
                if (p2==p3){
                    System.out.println("密码修改成功，您的新密码为"+p2);
                    break;
                }else {
                    System.out.println("两次密码输入不一致");
                    break;
                }
            }else {
                System.out.println("用户名或密码输入有误");
                break;
            }
        }
    }
}
